home *** CD-ROM | disk | FTP | other *** search
/ Underground / Underground CD1.iso / hack / progsy / hasla / johnr15 / DOC / RULES < prev   
Encoding:
Text File  |  1998-05-15  |  7.0 KB  |  178 lines

  1.  
  2.  Wordlist Rules Syntax
  3. =======================
  4.  
  5. Each wordlist rule consists of one or more simple commands, listed all on
  6. one line and optionally separated by spaces. There's also a preprocessor,
  7. which generates multiple rules for a single source line. Below you'll find
  8. the descriptions of rule commands (many of them are compatible with Crack
  9. 5.0), and preprocessor syntax (my own invention).
  10.  
  11.  Position Codes
  12. ----------------
  13.  
  14. Character positions are numbered starting with 0, and specified in rules
  15. by the following characters:
  16.  
  17. 0...9    for 0...9
  18. A...Z    for 10...35
  19. *    for max_length
  20. -    for (max_length - 1)
  21. +    for (max_length + 1)
  22.  
  23. Here max_length is the maximum plaintext length supported for current
  24. ciphertext format.
  25.  
  26. The same characters are also used for specifying other numeric parameters.
  27.  
  28.  Character Classes
  29. -------------------
  30.  
  31. ??    matches '?'
  32. ?v    matches vowels: "aeiouAEIOU"
  33. ?c    matches consonants: "bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ"
  34. ?w    matches whitespace: " \t"
  35. ?p    matches punctuation: ".,:;'\"?!`"
  36. ?s    matches symbols "$%^&*()-_+=|\\<>[]{}#@/~"
  37. ?l    matches lowercase letters [a-z]
  38. ?u    matches uppercase letters [A-Z]
  39. ?d    matches digits [0-9]
  40. ?a    matches letters [a-zA-Z]
  41. ?x    matches letters and digits [a-zA-Z0-9]
  42.  
  43. The complement of a class can be specified by uppercasing its name. For
  44. example, '?D' matches everything but digits.
  45.  
  46.  Simple Commands
  47. -----------------
  48.  
  49. :    no-op: do nothing to the input word
  50. l    convert to lowercase
  51. u    convert to uppercase
  52. c    capitalize
  53. C    lowercase the first character, and uppercase the rest
  54. t    toggle case of all characters in the word
  55. r    reverse: "Fred" -> "derF"
  56. d    duplicate: "Fred" -> "FredFred"
  57. f    reflect: "Fred" -> "FredderF"
  58. {    rotate the word left: "jsmith" -> "smithj"
  59. }    rotate the word right: "smithj" -> "jsmith"
  60. $X    append character X to the word
  61. ^X    prepend character X to the word
  62.  
  63.  Length Control Commands
  64. -------------------------
  65.  
  66. <N    reject the word unless it is less than N characters long
  67. >N    reject the word unless it is greater than N characters long
  68. 'N    truncate the word at length N
  69.  
  70.  English Grammar Commands
  71. --------------------------
  72.  
  73. p    pluralize: "crack" -> "cracks", etc (lowercase only)
  74. P    "crack" -> "cracked", etc (lowercase only)
  75. I    "crack" -> "cracking", etc (lowercase only)
  76.  
  77.  Insert/Delete Commands
  78. ------------------------
  79.  
  80. [    delete the first character
  81. ]    delete the last character
  82. DN    delete the character in position N
  83. xNM    extract substring from position N for up to M characters
  84. iNX    insert character X in position N and shift the rest right
  85. oNX    overstrike character in position N with character X
  86.  
  87. Note that '[' and ']' are control characters to the preprocessor: you
  88. should escape them with a '\' if using these commands.
  89.  
  90.  Charset Conversion Commands
  91. -----------------------------
  92.  
  93. S    shift case: "Crack96" -> "cRACK(^"
  94. V    lowercase vowels: "Crack96" -> "CRaCK96"
  95. R    shift each character right, by keyboard: "Crack96" -> "Vtsvl07"
  96. L    shift each character left, by keyboard: "Crack96" -> "Xeaxj85"
  97.  
  98.  Memory Access Commands
  99. ------------------------
  100.  
  101. M    memorize the word
  102. Q    reject the word unless it has changed
  103.  
  104.  Character Class Commands
  105. --------------------------
  106.  
  107. sXY    replace all characters X in the word with Y
  108. s?CY    replace all characters of class C in the word with Y
  109. @X    purge all characters X from the word
  110. @?C    purge all characters of class C from the word
  111. !X    reject the word if it contains character X
  112. !?C    reject the word if it contains a character in class C
  113. /X    reject the word unless it contains character X
  114. /?C    reject the word unless it contains a character in class C
  115. =NX    reject the word unless character in position N is equal to X
  116. =N?C    reject the word unless character in position N is in class C
  117. (X    reject the word unless its first character is X
  118. (?C    reject the word unless its first character is in class C
  119. )X    reject the word unless its last character is X
  120. )?C    reject the word unless its last character is in class C
  121. %NX    reject the word unless it contains at least N instances of X
  122. %N?C    reject the word unless it contains at least N characters of class C
  123.  
  124.  Extra "Single Crack" Mode Commands
  125. ------------------------------------
  126.  
  127. When defining "single crack" mode rules, extra commands are available for
  128. word pairs support, to control if other commands are applied to the first,
  129. second, or both words:
  130.  
  131. 1    first word only
  132. 2    second word only
  133. +    the concatenation of both (should only be used after a '1' or '2')
  134.  
  135. If you use some of the above commands in a rule, it will only process word
  136. pairs (full names, from the GECOS information), and reject single words.
  137. A '+' is assumed at the end of any rule that uses some of these commands,
  138. unless you specify it manually. For example, '1l2u' will convert the first
  139. word to lowercase, the second one to uppercase, and use the concatenation
  140. of both. The use for a '+' might be to apply some more commands: '1l2u+r'
  141. will reverse the concatenation of both words, after applying some commands
  142. to them separately.
  143.  
  144.  The Rule Preprocessor
  145. -----------------------
  146.  
  147. The preprocessor is used to combine similar rules into one source line.
  148. For example, if you need to make John try lowercased words with digits
  149. appended, you could write a rule for each digit, 10 rules total. Now
  150. imagine appending two-digit numbers -- the configuration file would get
  151. large and ugly.
  152.  
  153. With the preprocessor you can do these things easier. Simply write one
  154. source line containing the common part of these rules, and the list of
  155. characters you would have put into separate rules, in brackets (the way
  156. you would do in a regular expression). The preprocessor will then generate
  157. the rules for you (at startup for syntax checking, and once again while
  158. cracking, but never keeping all the expanded rules in memory). For the
  159. examples above, the source lines will be 'l$[0-9]' (lowercase and append a
  160. digit) and 'l$[0-9]$[0-9]' (lowercase and append two digits). These source
  161. lines will be expanded to 10 and 100 rules respectively. By the way, the
  162. preprocessor's commands are processed right-to-left, and the characters
  163. are processed left-to-right, which gets a normal order of numbers in such
  164. cases as in the example with appending two-digit numbers. Note that I only
  165. used character ranges in these examples, however you can combine them with
  166. character lists, like '[aeiou]' will use vowels, and '[aeiou0-9]' will use
  167. vowels and digits. If you need to try vowels first, and then all the other
  168. letters, you can use '[aeioua-z]' -- the preprocessor is smart enough not
  169. to produce duplicate rules in such cases.
  170.  
  171. There're some control characters in rules ('[' starts a preprocessor's
  172. character list, '-' marks a range inside the list, etc). You should prefix
  173. them with a '\' if you want to put them inside a rule without using their
  174. special meaning. Of course, the same applies to '\' itself. Also, if you
  175. need to start a preprocessor's character list at the very beginning of a
  176. line, you'll have to prefix it with a ':', or it would be treated as a new
  177. section start.
  178.